package com.xms.config;

import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 * ApplicationConfig
 * </p>
 *
 * @author migo
 * @since 2021/10/1
 */
@EnableCaching
@Configuration
public class ApplicationConfig extends CachingConfigurerSupport {

    /**
     * 配置缓存KEY生成器
     * @return
     */
    @Bean("CacheKeyGenerator")
    public KeyGenerator keyGenerator() {
        return new CacheKeyGenerator();
    }
}

